#include "flVector4.h"

flVector4::flVector4(float _x, float _y, float _z, float _w)
{
	x = _x;
	y = _y;
	z = _z;
	w = _w;
}

void flVector4::set(float _x, float _y, float _z, float _w)
{
	x = _x;
	y = _y;
	z = _z;
	w = _w;
}
		
/*
	Overloading operators
*/
bool flVector4::operator==(const flVector4& v)
{
	return (x == v.x) && (y == v.y) && (z == v.z) && (w == v.w);
}
bool flVector4::operator!=(const flVector4& v)
{
	return (x != v.x) || (y != v.y) || (z != v.z) || (w != v.w);
}

// Functions with other Vector4
void		flVector4::operator=	(const flVector4& v)
{
	x = v.x;
	y = v.y;
	z = v.z;
	w = v.w;
}
flVector4	flVector4::operator+	(const flVector4& v) const
{
	return flVector4(x + v.x, y + v.y, z + v.z, w + v.w);
}
flVector4&	flVector4::operator+=	(const flVector4& v)
{
	x += v.x;
	y += v.y;
	z += v.z;
	w += v.w;
	return *this;
}
flVector4	flVector4::operator-	(const flVector4& v) const
{
	return flVector4(x - v.x, y - v.y, z - v.z, w - v.w);
}
flVector4&	flVector4::operator-=	(const flVector4& v)
{
	x -= v.x;
	y -= v.y;
	z -= v.z;
	w -= v.w;
	return *this;
}
flVector4	flVector4::operator*	(const flVector4& v) const
{
	return flVector4(x * v.x, y * v.y, z * v.z, w * v.w);
}
flVector4&	flVector4::operator*=	(const flVector4& v)
{
	x *= v.x;
	y *= v.y;
	z *= v.z;
	w *= v.w;
	return *this;
}
flVector4	flVector4::operator/	(const flVector4& v) const
{
	return flVector4(x / v.x, y / v.y, z / v.z, w / v.w);
}
flVector4&	flVector4::operator/=	(const flVector4& v)
{
	x /= v.x;
	y /= v.y;
	z /= v.z;
	w /= v.w;
	return *this;
}

// Functions with float
void		flVector4::operator=	(const float f)
{
	x = f;
	y = f;
	z = f;
	w = f;
}
flVector4	flVector4::operator+	(const float f) const
{
	return flVector4(x + f, y + f, z + f, w + f);
}
flVector4&	flVector4::operator+=	(const float f)
{
	x += f;
	y += f;
	z += f;
	w += f;
	return *this;
}
flVector4	flVector4::operator-	(const float f) const
{
	return flVector4(x - f, y - f, z - f, w - f);
}
flVector4&	flVector4::operator-=	(const float f)
{
	x -= f;
	y -= f;
	z -= f;
	w -= f;
	return *this;
}
flVector4	flVector4::operator*	(const float f) const
{
	return flVector4(x * f, y * f, z * f, w * f);
}
flVector4&	flVector4::operator*=	(const float f)
{
	x *= f;
	y *= f;
	z *= f;
	w *= f;
	return *this;
}
flVector4	flVector4::operator/	(const float f) const
{
	return flVector4(x / f, y / f, z / f, w / f);
}
flVector4&	flVector4::operator/=	(const float f)
{
	x /= f;
	y /= f;
	z /= f;
	w /= f;
	return *this;
}